<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>Title</title>
    <%@include file="/common/common_css.jsp"%>
</head>
<body>
    <div class="container" style="margin-top: 30px;">

        <div id="myModal" class="modal fade" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">图书</h4>
                    </div>
                    <div class="modal-body">

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" onclick="submitForm(this)">确认</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal-dialog -->
        <div id="modalExcel" class="modal fade" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">Modal title</h4>
                    </div>
                    <div class="modal-body">

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" onclick="batchInsert()">保存</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
        <div id="toolbar">
            <form action="" style="float: left;" method="post" class="form-inline">
                <div class="form-group">
                    <label for="username">图书名</label>
                    <input type="text" class="form-control" name="username" id="username">
                </div>
                <div class="form-group">
                    <label for="roleCondition">类型</label>
                        <select class="form-control" id="roleCondition" name="leixing">
                            <option value="-1">全部</option>
                        <c:forEach items="${requestScope.leixings}" var="leixing">
                             <option value="${leixing.lx_id}">${leixing.lx_name}</option>
                        </c:forEach>
                    </select>
                </div>
            </form>

            <button onclick="setCondition('#tbl_user')" class="btn btn-default"><span class="glyphicon glyphicon-search"></span>搜索</button>
            <button onclick="toAdd('新增','tushu/add')" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span>添加</button>
            <button onclick="batchDel('tushu/batchDel','#tbl_user')" class="btn btn-success"><span class="glyphicon glyphicon-trash"></span>批量删除</button>
            <button class="btn btn-warning" onclick="batchAdd('批量添加','tushu/batchAdd')">批量添加图书</button>
        </div>
        <table id="tbl_user"></table>
    </div>
    <%@include file="/common/common_js.jsp"%>
    <script src="static/js/book/book.js"></script>
</body>
</html>
